// import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import BasicLayout from '../layouts/BasicLayout'

const RouteView = {
    name: 'RouteView',
    render: (h) => h('router-view')
}

/* 预设动态路由 */
export const asyncRouterMap = []

export const constantRouterMap = [{
        path: '/',
        name: 'home',
        component: () =>
            import ('@/views/home/Home')
    },
    {
        path: '/user/login',
        name: 'login',
        component: () =>
            import ('@/views/login/Login')
    },
    {
        path: '/public',
        name: 'index',
        redirect: '/public/paper/create',
        component: BasicLayout,
        children: [
            // {
            //     path: '/public/index',
            //     name: 'index',
            //     meta: { title: '首页', keepAlive: true, icon: 'menu' },
            //     component: () =>
            //         import ('@/views/paper/Create'),

            // },
            {
                path: '/public/paper',
                name: 'paper',
                component: RouteView,
                meta: { title: '问卷平台', keepAlive: false, icon: 'form' },
                children: [{
                    path: '/public/paper/create/:pageNo([1-9]\\d*)?',
                    name: 'createPaper',
                    meta: { title: '创建问卷', keepAlive: false, icon: false },
                    component: () =>
                        import ('@/views/paper/Create'),
                    // component: resolve => require(['@/views/paper/Create'], resolve)
                }, {
                    path: '/public/paper/userPaper',
                    name: 'userPaper',
                    meta: { title: '我的问卷', keepAlive: false, icon: false },
                    component: () =>
                        import ('@/views/paper/UserPaper'),
                    // component: resolve => require(['@/views/paper/UserPaper'], resolve)
                }, {
                    path: '/public/paper/managePaper',
                    name: 'managePaper',
                    meta: { title: '问卷管理', keepAlive: false, icon: false },
                    component: () =>
                        import ('@/views/paper/ManagePaper'),
                    // component: resolve => require(['@/views/paper/ManagePaper'], resolve)
                }, {
                    path: '/public/paper/manageResult',
                    name: 'manageResult',
                    meta: { title: '答案管理', keepAlive: false, icon: false },
                    component: () =>
                        import ('@/views/paper/ManageResult'),
                    // component: resolve => require(['@/views/paper/ManagePaper'], resolve)
                }]
            }
            // {
            //     path: '/public/basic',
            //     name: 'publicBasic',
            //     component: RouteView,
            //     meta: { title: '基础功能', keepAlive: true, icon: 'appstore' },
            //     children: [{
            //         path: '/public/basic/autoreply',
            //         name: 'publicBasic1',
            //         meta: { title: '自动回复', keepAlive: true, icon: false },
            //         component: () =>
            //             import ('@/views/paper/Create'),
            //     }, {
            //         path: '/public/basic/menu',
            //         name: 'publicBasic2',
            //         meta: { title: '自定义菜单', keepAlive: true, icon: false },
            //         component: () =>
            //             import ('@/views/paper/Create'),
            //     }]
            // }
        ]
    }
]